package com.chenfwind.serviceImpl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.chenfwind.IDao.UserTrackMapper;
import com.chenfwind.domain.UserTrack;
import com.chenfwind.service.UserTrackService;

@Service("userTrackService")
public class UserTrackServiceImpl implements UserTrackService{
	
	@Autowired
	private UserTrackMapper userTrackDao;
	
	public UserTrack getTrackByUserIDAndStatus(String userID){
		return userTrackDao.selectByUserIDAndStatus(userID, 1);
	}
	
	public List<UserTrack> getTrackByUserID(String userID){
		return userTrackDao.selectByUserID(userID);
	}
	
	public int insertUserTrack(UserTrack userTrack){
		return userTrackDao.insertSelective(userTrack);
	}
	
	public int getMax(String userID){
		return userTrackDao.selectMax(userID);
	}
	
	public int updateStatusByID(UserTrack record){
		return userTrackDao.updateByPrimaryKeySelective(record);
	}
}
